/*    */ package com.wgcloud.service;
/*    */ 
/*    */ import com.github.pagehelper.PageHelper;
/*    */ import com.github.pagehelper.PageInfo;
/*    */ import com.wgcloud.entity.DbTable;
/*    */ import com.wgcloud.mapper.DbTableMapper;
/*    */ import com.wgcloud.util.DateUtil;
/*    */ import com.wgcloud.util.UUIDUtil;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import org.apache.commons.lang3.StringUtils;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Service;
/*    */ import org.springframework.transaction.annotation.Transactional;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Service
/*    */ public class DbTableService
/*    */ {
/*    */   @Autowired
/*    */   private DbTableMapper dbTableMapper;
/*    */   
/*    */   public PageInfo selectByParams(Map<String, Object> params, int currPage, int pageSize) throws Exception {
/* 29 */     PageHelper.startPage(currPage, pageSize);
/* 30 */     List<DbTable> list = this.dbTableMapper.selectByParams(params);
/* 31 */     PageInfo<DbTable> pageInfo = new PageInfo(list);
/* 32 */     return pageInfo;
/*    */   }
/*    */   
/*    */   public void save(DbTable dbTable) throws Exception {
/* 36 */     dbTable.setId(UUIDUtil.getUUID());
/* 37 */     dbTable.setCreateTime(DateUtil.getNowTime());
/* 38 */     this.dbTableMapper.save(dbTable);
/*    */   }
/*    */   
/*    */   public int countByParams(Map<String, Object> params) throws Exception {
/* 42 */     return this.dbTableMapper.countByParams(params);
/*    */   }
/*    */   
/*    */   public Long sumByParams(Map<String, Object> params) throws Exception {
/* 46 */     return this.dbTableMapper.sumByParams(params);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public int deleteById(String[] id) throws Exception {
/* 51 */     return this.dbTableMapper.deleteById(id);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public int deleteByDbInfoId(String dbInfoId) throws Exception {
/* 56 */     if (StringUtils.isEmpty(dbInfoId)) {
/* 57 */       return 0;
/*    */     }
/* 59 */     return this.dbTableMapper.deleteByDbInfoId(dbInfoId);
/*    */   }
/*    */ 
/*    */   
/*    */   public void updateById(DbTable dbTable) throws Exception {
/* 64 */     this.dbTableMapper.updateById(dbTable);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public void updateRecord(List<DbTable> recordList) throws Exception {
/* 69 */     if (recordList.size() < 1) {
/*    */       return;
/*    */     }
/* 72 */     this.dbTableMapper.updateList(recordList);
/*    */   }
/*    */   
/*    */   public DbTable selectById(String id) throws Exception {
/* 76 */     return this.dbTableMapper.selectById(id);
/*    */   }
/*    */   
/*    */   public List<DbTable> selectAllByParams(Map<String, Object> params) throws Exception {
/* 80 */     return this.dbTableMapper.selectAllByParams(params);
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/service/DbTableService.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */